//
//  OMGCollectionViewCell.m
//  A_project2.0
//
//  Created by dllo on 16/3/11.
//  Copyright © 2016年 七平. All rights reserved.
//

#import "OMGCollectionViewCell.h"

@implementation OMGCollectionViewCell

// 初始化
- (instancetype) initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.photoImg = [[UIImageView alloc] init];
//        _photoImg.backgroundColor = [UIColor yellowColor];
        _photoImg.layer.cornerRadius = 10;
        _photoImg.clipsToBounds = YES;
        [self.contentView addSubview:_photoImg];
        
        self.total_threadLabel = [[UILabel alloc] init];
//        _total_threadLabel.backgroundColor = [UIColor redColor];
        _total_threadLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_total_threadLabel];
        
        self.nameLabel = [[UILabel alloc] init];
//        _nameLabel.backgroundColor = [UIColor greenColor];
        _nameLabel.font = [UIFont systemFontOfSize:11];
        _nameLabel.numberOfLines = 2;
        [self.contentView addSubview:_nameLabel];
        
    }
    return self;
}

// 布局方法
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _photoImg.frame = CGRectMake(0, 0, 50, layoutAttributes.size.height);
    _nameLabel.frame = CGRectMake(60, 0, 100, 28);
    _total_threadLabel.frame = CGRectMake(60, 28, 100, 10);

}

@end
